cmake_minimum_required(VERSION 3.1)

set(CPP_SOURCES
    main.cpp
    logutils.h
    logutils.cpp
)

QT5_ADD_RESOURCES(QML_QRC qml.qrc res.qrc)

set(RESOURCE_DIR res)

add_executable(${PROJECT_NAME} ${CPP_SOURCES} ${QML_QRC})
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick)

install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
install(DIRECTORY ${RESOURCE_DIR} DESTINATION ${INSTALLER_DIR})